'/
' MOTEP - Massive Online Text Environment Project
' --------------------------------------------------------------------------------
' MOTEP Server
' 
' Commands.bmx
' 
' (c) Anton Berlin. All Rights Reserved.
'/

type cmd_quit extends TCommand
	method Execute:byte(args:string = null)
		Master.m_stopEvent = true
		write("Avslutar servern...")
		return 1
	end method
	
	method Name:string()
		return "quit"
	end method
end type
rem
type cmd_look extends TCommand
	method Execute:byte(args:string = null)
		write(AccessRoom(World.SPObj.m_region, SPObj.m_posX, SPObj.m_posY, SPObj.m_posZ).m_descr)
		
		local exits:string
		for local e:TExit = eachin AccessRoom(World.SPObj.m_region, SPObj.m_posX, SPObj.m_posY, SPObj.m_posZ).m_exits
			if (exits) then
				exits = exits + ", " + e.direction
			else
				exits = e.direction
			end iIf
		next
		write("  Exits: " + exits)
		
		local count:int = 0
		for local o:TObject = eachin AccessRoom(World.SPObj.m_region, SPObj.m_posX, SPObj.m_posY, SPObj.m_posZ).m_localObjList
			count:+1
			write(count + ". " + o.m_name)
		next
		return 1
	end method
	
	method Name:string()
		return "look"
	end method
end type

type cmd_pos extends TCommand
	method Execute:byte(args:string = null)
		write("Position: " + SPObj.m_posX + "x" + SPObj.m_posY + "x" + SPObj.m_posZ)
		return 1
	end method
	
	method Name:string()
		return "pos"
	end method
end type
end rem